#include "DeletePatient.h"
#include <QApplication>

namespace UserManagementSystem {
DeletePatient::DeletePatient(QWidget *parent)
    :  BaseDialogWithShadow(parent)
{
    this->setWindowFlags(this->windowFlags() | Qt::WindowStaysOnTopHint|Qt::Dialog);
    this->show(); // 重新 show 一下才能生效

    this->setFixedSize(500,300);


    if(this->GetContentWidget()){
        //设置宽高
        this->GetContentWidget()->setMinimumSize(500,300);

    }

    //获得工作窗口的内容窗口
    m_contentWidget=this->GetContentWidget()->GetContentWindow();


    m_mainLayout=new QVBoxLayout(m_contentWidget);
    m_subLayout=new QHBoxLayout();

    QString pix_path=QApplication::applicationDirPath()+"/res/PatientManager/tip_icon.png";
    QPixmap pix(pix_path);

    m_tipIcon.setPixmap(pix);
    m_tipLab.setText(tr("同时删除患者病例及数据"));

    SetDefaultLayout();
}

void DeletePatient::SetDefaultLayout()
{

    m_mainLayout->setAlignment(Qt::AlignCenter);
    m_subLayout->addWidget(&m_tipIcon);
    m_subLayout->addWidget(&m_tipLab);

    m_mainLayout->addLayout(m_subLayout);
}
}

